DEFINE VARIABLE str AS CHARACTER FORMAT "X(60)".
DEFINE VARIABLE k AS INTEGER.

OUTPUT TO c:\qadguicli\my.txt.

FOR EACH pt_mstr WHERE pt_part_type = "P000" NO-LOCK:

    str = "".
    k = 0.
    FOR EACH ptp_det WHERE ptp_part = pt_part NO-LOCK:
        str = str + "+" + ptp_site.
        k = k + 1.
    END.
    IF k < 2 THEN
    DISP pt_part_type pt_part pt_desc1 pt_site str WITH STREAM-IO WIDTH 200.
END.
